<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'photo-form',
	'enableAjaxValidation'=>false,

    'htmlOptions' => array(
        'enctype' => 'multipart/form-data'
    )                                                                                       
));

    if(!isset($update_mode)){
        $update_mode = false;
    }

    ?>

	<p class="note">Обязательные поля <span class="required">*</span></p>

	<?php echo $form->errorSummary($model); ?>

    <?php echo $form->hiddenField($model, 'hotel_id'); ?>
    <?php echo $form->hiddenField($model, 'tour_id'); ?>
    <?php echo $form->hiddenField($model, 'path_to_preview'); ?>
    <?php echo $form->hiddenField($model, 'path_to_original'); ?>
    <?php echo $form->hiddenField($model, 'path_to_thumb'); ?>

    <? if(!$update_mode): ?>
        <div class="row">
            <?php echo $form->labelEx($model,'file'); ?>
            <?php echo CHtml::activeFileField($model, 'file'); ?>
            <?php echo $form->error($model,'file'); ?>
        </div>
    <? endif; ?>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Создать' : 'Сохранить'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->